<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
	<script type="text/javascript">
		//数组的去重
		let arr = [1, 2, 4, 2, 3, 11, 44, 22, 22, 63, 11]

		let newArr = []
		newArr[0] = arr[0]
		for(let i = 0; i < arr.length; i++){
			let flag = false;//默认没有重复的
			for(let j = 0; j < newArr.length; j++){
				if(arr[i] === newArr[j]){
					//跟newArr里的每一项比较
					flag = true
					break;
				}
			}
			//如果跟newArr比较完还是false，说明newArr里没有重复的
			if (!flag) {
				newArr.push(arr[i])
			}
		}
		console.log(newArr)
	</script>
</body>
</html>